package nz.co.kevindoran.googlechartsjsf;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;


public class DefaultGoogleChartModel implements GoogleChartModel {
      
    private String chartType;
    private String chartPackage;
    private Collection<Column> columns = new ArrayList<>();
    private Collection<Row> rows = new ArrayList<>();
    private String options;
    
    public DefaultGoogleChartModel() {}
    
    public DefaultGoogleChartModel(String chartType) {
        this(chartType.toLowerCase(), chartType);
    }
    
    public DefaultGoogleChartModel(String chartPackage, String chartType) {
        this.chartPackage = chartPackage;
        this.chartType = chartType;
    }
    
    @Override
    public String getChartType() {
        return chartType;
    }

    @Override
    public Collection<Column> getColumns() {
        return columns;
    }

    @Override
    public Collection<Row> getRows() {
        return rows;
    }

    @Override
    public void setChartType(String chartType) {
        this.chartType = chartType;
    }

    
    @Override
    public void addColumn(Column column) {
        columns.add(column);
    }

    
    @Override
    public void addRow(Row row) {
        rows.add(row);
    }

    @Override
    public String getChartPackage() {
        return chartPackage;
    }

    @Override
	public void setChartPackage(String chartPackage) {
        this.chartPackage = chartPackage;
    }

    @Override
    public void setOptions(String options) {
        this.options = options;
    }

    @Override
    public String getOptions() {
        return options;
    }
}
